package com.tao.mapper;

import com.github.pagehelper.Page;
import com.tao.annotation.AutoFill;
import com.tao.enumeration.OperationType;
import com.tao.pojo.dto.PageSelectCategoryDto;
import com.tao.pojo.entity.Category;
import com.tao.pojo.vo.CategoryVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @AutoFill(value = OperationType.INSERT)
    void addCategoryMapper(Category category);

    @Delete("delete from category where id=#{id}")
    void deleteCategoryMapper(Integer id);

    @AutoFill(value = OperationType.UPDATE)
    void updateCategoryMapper(Category category);

    Page<CategoryVo> pageSelectCategoryMapper(PageSelectCategoryDto pageSelectCategoryDto);


    List<Category> selectCategoryByType(Integer type);


    Category selectCategoryById(Integer id);
}
